<template>
	<view @click="handleClick" class="machine">
		<view class="name">
			<view class="content">
				{{machine.name}}
			</view>
			<!-- <view v-if='check' class="check">
				当前选择
			</view> -->
		</view>
		<view class="address">
			<view class="text">
				{{machine.address}}
			</view>
			<view class="icon">
				<image :src="machineLog" mode="">
			</view>
		</view>
		<view class="loaction">
			<view class="distance">
				<u-icon name="map" color="#c9cace" size="30"></u-icon>
				<view style="color:#000;min-width: 160rpx;" class="text">
					距您{{machine.distance}}km
				</view>
			</view>
		</view>
		<!-- <view class="time">
			<u-icon name="clock" color="#c9cace" size="28"></u-icon>
			<view class="text">
				{{machine.time}}
			</view>
		</view> -->
	</view>
</template>

<script>
	import '@/static/iconfont/iconfont.css'
	import machineLog from '@/pages/tabBar/static/images/location.png'
	export default {
		name: "machine",
		data() {
			return {
				machineLog: machineLog
			}
		},
		props: {
			machine: {
				type: Object
			},
			value: {
				type: Number
			}
		},
		methods: {
			handleClick() {
				this.$emit("click")
			}
		}
		// computed: {
		// 	check() {
		// 		return this.value === this.machine.mid
		// 	}
		// }
	}
</script>

<style lang="scss" scoped>
	$text-color: #c9cace;

	.machine {
		width: 100%;
		height: 240rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		padding: 28rpx 50rpx;
		background-color: #fff;
		border-top: 1px solid $text-color;

		.name {
			display: flex;
			font-weight: 900;
			align-items: center;

			// .check {
			// 	background-color: #f08571;
			// 	border-radius: 5rpx;
			// 	color: #fff;
			// 	height: 24rpx;
			// 	font-size: 18rpx;
			// 	margin-left: 10rpx;
			// 	font-weight: 400;
			// 	padding: 0 6rpx;
			// }
		}

		.address {
			position: relative;
			// display: flex;
			// justify-content: space-between;
			width: 100%;

			.text {
				width: 88%;
				// 	overflow: hidden;
				// 	white-space: nowrap;
				// 	text-overflow: ellipsis;
			}

			.icon {
				position: absolute;
				top: -6rpx;
				right: 10rpx;
				width: 60rpx;
				height: 60rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				border-radius: 50%;
				background-color: #ebebeb;

				image {
					width: 32rpx;
					height: 32rpx;
				}
			}
		}

		.loaction {
			display: flex;
			justify-content: space-between;

			.distance {
				display: flex;
				align-items: center;
			}
		}

		.time {
			display: flex;
			font-size: 26rpx;
		}
	}

	.text {
		color: $text-color;
	}
</style>